import torch
def _test():
    w = torch.tensor(1.0, requires_grad=True,dtype=torch.float32)
    for _ in range(10):
        x = w **2+20
        x.backward()
        print(w.grad)
if __name__ == '__main__':
        _test()